Comet allows you to create macros to perform functions such as moving the cursor, making a selection, or appending the selection to a file. Dialogs in the Control menu allow you to enter a sequence of macro commands and associate the macro with key-combinations (such as Control Option A) you enter on the keyboard or the mouse double-click (using ("Define key macros" or "Set double-click macro" in the Control menu). You can also define a macro to execute immediately upon the connection with a host ("Set connection macro").
The Key Macro on/off switch is in the Control menu; when macros are on, an M appears in a box at the lower right hand corner of the screen. When a key macro is currently executing, the M appears in reverse video; the reverse M also appears if keystrokes are pending execution in the key queue. If you wish to cancel the execution of a macro or pending keyststrokes, use Command-'.'.
When the dialog for entering key macros comes up, you have three options: select a key, get help, show a list of macros currently associated with keys, or quit the dialog. A prompt appears saying "You may press a key-combination to modify the macro for that key..." If you press a key-combination, the dialog will show you the name of the key, and will allow you to enter actions (text and commands) you want the key-combination to produce. If there is a key macro associated with that key, the Delete key will be turned on, and the actions associated with the key will be displayed. Note that holding down the mouse button when you press the key-combination will identify the key as an "Alt-key," and such a macro will only be matched if the "ALT" state is set using the "!CA" command documented below (this allows you to switch keyboard configurations with a keystroke, and is used with library keymapping--see the "ALA" Comet configuration document for an example of extensive key remapping). When the "ALT" state is on, "Alt-" flag above the "M" which shows that key macros are on.
You can modify the macro text by entering new text or using copy and paste with the Command-C and Command-V keys. Command-. cancels your modifications to the key macro. When you are finished, you must press the Set button if you want the changes to take effect. The program will then alert you if your entry has errors in the length of the codes. (PLEASE NOTE that the codes are not checked for validity until you execute a key macro by typing the key when you have quit the dialog and Key Macros are set on! Alerts will then inform you of any errors.) If there is no error, the macros are updated immediately; there is no need to save the configuration to save the key macros in the document. If you decide not to change the text, you should press the Cancel button. You can then quit if you wish, or add, remove, or modify other keys.
Text which you enter in the key macro window can be interpreted as either plain text or commands. Individual characters stand for themselves--except for '!' & '\', which can be entered by using '!!' and '\\'. These two characters are special: '!' is used to introduce a command; '\' is used to enter a number, specified using three decimal digits, such as "\010". This numeric entry can be used either in place of a character, or to enter a decimal numeric value.
ASCII control characters can be entered by pressing the option key and the character ('a' through 'z', Space, '[', ']', '\', '@', '^', '_', or '?').
Ordinary text can be entered directly in the text-editing field of the dialog. Commands are entered as a '!' (exclamation point) followed by a pair of characters; the first character selects a class of action, and the second the particular type of this action. In IBM mode, the macro dialogs present buttons to perform input of all the IBM function keys. (PLEASE NOTE that versions of Comet after 2.1B3 no longer automatically map the Return key to produce an "Enter," so you need to press the "Enter" button to send an Enter command to the host using a macro.) The action classes and associated characters available in both ASCII and the "IBM Keymapping" modes are as follows:
Perform an emulator action: (C) followed by a code:
'A' Set the ALT (mousedown state) modifier bit for
all key-combinations.
'a' Set ALT off.
'C' Close the session without a dialog.
'E' Show the .edit window.
'F' Close the copyright/help textwindow.
'H' Don't update the display.
'L' Display all received characters as literals in ASCII
emulators.
'R' Restore line 25.
'S' Update the display as usual.
'T' Show the terminal emulator window.
't' Toggle cursor positioning using the mouse.
'Z' Toggle fast drawing mode (useful for library data
entry checking).
Perform a formatted copy: (c) followed by a code:
'C' Clear the Clipboard.
'a' Copy an RLIN library Name Authority record and convert
it into a NOTIS record; if the first line of the
selection does not contain the "ID:" field, it is
assumed to be a continuation of a record and is
appended to the portion of a record in the Clipboard.
'b' Copy an RLIN Book record and convert it into a NOTIS
record, as described above.
Perform an editing action: (E) followed by a code:
'A' Select the whole screen or text.
'B' Append the selection to the session's .edit window.
'C' Copy the selection to the Clipboard.
'S' Use the standard text mode for copying the selection.
'T' Use the Table mode when copying the selection.
'V' Paste the selection into the emulator screen or the
.edit window.
'W' Select the word where the emulator cursor is located
(the default double-click action).
'X' Cut the selection range (works only with the .edit
window).
Perform a file action: (F) followed by a code:
'A' Append the selection to a file.
'B' Append the selection to a file selected through a
Standard Put File dialog.
'D' Print the emulator screen using Apple's no-longer-
supported Streaming Text Print Manager routines.
May crash with some Printer Drivers (for example
the StyleWriter driver), but gives better alignment
of columns when using a laser printer.
'P' Print the emulator screen using Apple's standard
Print Manager routines.
'p' Print the .text window using Apple's standard Print
Manager routines.
'S' Save the selection in a file; if a file has not been
opened, a Put File dialog will be performed.
'T' Save the selection in a file; always present the Put
File dialog.
Move the cursor: (M), and a code:
'L' Move the cursor to the left;
'D' Move the cursor down;
'U' Move the cursor up;
'R' Move the cursor right.
Move to X-coordinate: (X) followed by a decimal number specifying the column number (0-255).
Move to Y-coordinate: (Y) followed by a decimal number specifying the row number (0-32). The Y command always positions the cursor in column 0.
To make a selection: you must use four commands to set a selection range, each of which uses a number to specify the position on the screen numbered from 0:
'S' selection start Y position, followed by the position number;
'T' selection start X position, followed by the position number;
'U' selection end Y position, followed by the position number;
'V' selection end X position, followed by the position number.
When all four codes have been received, the selection will be made.
Delay: (D) followed by the number of seconds to wait specified as \nnn, e.g. "!D\001".
Loop: (L) followed by the number of times to repeat the sequence of macro commands which follows; this sequence must be terminated by an entry containing "!L\000" (loop zero). Using '\255' for the count will cause the loop to continue until the Command-. "cancel" key is pressed.
Delay session macro processing until host output matches string: (Z) followed by a number indicating the number of seconds to wait before aborting; if the number is '\255', it waits forever if the string is not matched. This entry is followed by a list of characters to match, terminated by any non-character macro command (usually a Delay entry).